<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>Document</title>
  <link rel="stylesheet" href="./css/jquery-weui.min.css">
  <link rel="stylesheet" href="./css/addAddress.css">
</head>
<body>
  <div id="Adress">
    <header class="add-adr-header"></header>
    <input type="text" class="add-adr-name must"  placeholder="姓名（请填写真实姓名）" >
    <input type="number" id="phone" class="must" placeholder="手机号码">
    <input type='text' class="must" id='city-picker' placeholder='请选择省市区县' />
    <input type="text" class="must" id="adrs" placeholder="详细地址（最长26个字符）">
    <input type="number" placeholder="邮编">
    <div class="subIt">
      <button type="button" class="add-btn-default">放弃</button>
      <button type="button" class="add-btn-default" id="finish">完成</button>
    </div>
    <span class="adr-sign">请完善表格信息</span>
  </div>
</body>
  <script src="./js/jquery.1.8.3.min.js" charset="utf-8"></script>
  <script src="./js/jquery-weui.min.js" charset="utf-8"></script>
  <script src="./js/city-picker.min.js" charset="utf-8"></script>
  <script src="./js/axios.min.js"></script>
  <script type="text/javascript">
    var address;
    $("#city-picker").cityPicker({
      title: "选择省市区/县",
      onChange: function (picker, values, displayValues) {
        // console.log(values, displayValues);
      },
      onClose: function(picker){
        address = picker.displayValue
      }
    });
    $("#finish").click(function(){
      if ($(".must").val() == "") {
        $(".adr-sign").fadeIn("slow", function(){
          $(this).fadeOut("slow");
        })
      } else {
        var name=$(".add-adr-name").val();
        var phone=$("#phone").val();
        var adrs=$("#adrs").val();
        // axios.post("  ", {
        //   address: address,
        //   name: name,
        //   phone: phone,
        //   adrs: adrs
        // })
        // .then(function(res){
        //   console.log(res);
        // })
        // .catch(function(err){
        //   console.log(err);
        // })
      }
    })

  </script>
</html>
